<!DOCTYPE HTML>
<html lang="zh">
<meta charset="utf-8">
<head>
    <link href="/aityWeb/static/css/font-awesome.css" rel="stylesheet"/>

    <style type="text/css">
        .nav > li:hover .dropdown-menu {display: block;}
    </style>

	<link href="/aityWeb/static/css/bootstrap.min.css" rel="stylesheet"/>
	<link href="/aityWeb/static/css/font-awesome.css" rel="stylesheet"/>

	<link href="/aityWeb/static/css/animate.css" rel="stylesheet"/>
	<link href="/aityWeb/static/css/style.css" rel="stylesheet"/>
	<link href="/aityWeb/static/css/checkbox.css" rel="stylesheet"/>
	<link href="/aityWeb/static/ajax/libs/select/select2.css" rel="stylesheet"/>
    <link href="/aityWeb/static/galaxy/css/ry-ui.css" rel="stylesheet"/>
    
    
</head>
<body class="gray-bg">
<div class="container-div">
	<div class="row">
		<div class="col-sm-12 select-info" style="padding-top: 10px;">
			<ul class="breadcrumb" style="font-size: 16px;background-color: #f3f3f3;padding: 5px 10px;color: #337ab7;">
			    <li><i class="fa fa-home" aria-hidden="true"></i>&nbsp;&nbsp;<a href="#">首页</a></li>
			    <li><i class="fa fa-home" aria-hidden="true"></i>&nbsp;&nbsp;<a href="#">俱乐部管理</a></li>
			    <li class="active"><a href="#">编辑</a></li>
			</ul>
			<div class="col-sm-6 " style="padding-top: 10px;height: 100%">

				<form class="form-horizontal" role="form" style="margin-top: 20px;">
					  <div class="form-group">
					    <label for="jlbmc" class="col-sm-2 control-label">俱乐部名称</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control" id="jlbmc" placeholder="请输入俱乐部名称">
					    </div>
					  </div>
					  <div class="form-group">
					    <label for="responsiblename" class="col-sm-2 control-label">负责人</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control" id="responsiblename" placeholder="请输入负责人">
					    </div>
					  </div>
						<div class="form-group">
					    <label for="groupnumber" class="col-sm-2 control-label">群号</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control" id="groupnumber" placeholder="请输入群号">
					    </div>
					  </div>

					  <div class="form-group">
					    <label for="desc" class="col-sm-2 control-label">说明</label>
					    <div class="col-sm-10">
					      <textarea rows="4" class="form-control"  id="desc" placeholder="请输入负责人"></textarea>
					    </div>
					  </div>

					  <div class="form-group">

					    <div class="col-sm-offset-2 col-sm-10">
					      <button type="button" class="btn btn-success" onclick="save();">上传</button>

					      <button type="button" class="btn btn-default" onclick="clubReturn();" style="margin-left: 10px;">返回</button>
					    </div>
					    
					  </div>
					</form>
			</div>
	
		</div>
	</div>
</div>

	<script src="/aityWeb/static/js/jquery.min.js"></script>
	<script src="/aityWeb/static/js/bootstrap.min.js"></script>

	
	<!-- jquery-validate 表单验证插件 -->
	<script src="/aityWeb/static/ajax/libs/validate/jquery.validate.min.js"></script>
	<script src="/aityWeb/static/ajax/libs/validate/messages_zh.min.js"></script>
	<script src="/aityWeb/static/ajax/libs/validate/jquery.validate.extend.js"></script>
	<!-- jquery-validate 表单树插件 -->
	<script src="/aityWeb/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js"></script>

	<!-- 遮罩层 -->
	<script src="/aityWeb/static/ajax/libs/blockUI/jquery.blockUI.js"></script>
	<script src="/aityWeb/static/ajax/libs/layer/layer.min.js"></script>
	<script src="/aityWeb/static/ajax/libs/layui/layui.js"></script>
	<script src="/aityWeb/static/galaxy/js/common.js?v=2.3.0"></script>
	<script src="/aityWeb/static/galaxy/js/ry-ui.js?v=2.3.0"></script>

	<script src="/aityWeb/static/js/app/net.js"></script>
	<script src="/aityWeb/static/js/app/app.js"></script>
	<script src="/aityWeb/static/js/lib/MD5.js"></script>

	<script type="text/javascript">
        var re = GetRequest();
        var clubid = re['id'];

        $(function() {

            if(clubid && 'undefined' != clubid){

                selectById(clubid);
			}
        });

        function selectById(){

            //查询参数准备
            var info = {
                page: 1,
                rows: 100,
                type:"select",
                id:parseInt(clubid)
            };
            //接口调用
            doPost("club/getClub",info,function(data){
                var row = data.data.rows[0];
                $("#jlbmc").val(row.name);
                $("#responsiblename").val(row.responsiblename);
                $("#groupnumber").val(row.groupnumber);
                $("#desc").val(row.desc);
            });
        }

        function save(){
            var info = {
                page: 1,
                rows: 100,
                name:$("#jlbmc").val(),
                responsibleName:$("#responsiblename").val(),
                groupNumber:$("#groupnumber").val(),
                desc:$("#desc").val()
            };
            var url ="";
            if(clubid && 'undefined' != clubid){
                info.id = parseInt(clubid);
                info.type = "update";
			}else{
                info.type = "add";
			}
            //接口调用
            doPost("club/getClub",info,function(data){
                if(data.status == 200){
                    $.loadInner.updateUrl("/aityWeb/view/clubManger/list.html");
				}

            });
		}

	    function clubSave(){
	        $.loadInner.updateUrl("/aityWeb/view/clubManger/list.html");
	    }

	    function clubReturn() {
	        $.loadInner.updateUrl("/aityWeb/view/clubManger/list.html");
	    }

        function GetRequest() {
            var url = location.search; //获取url中"?"符后的字串
            var theRequest = new Object();
            if (url.indexOf("?") != -1) {
                var str = url.substr(1);
                strs = str.split("&");
                for(var i = 0; i < strs.length; i ++) {
                    var name = strs[i].split("=")[0];
                    var value = strs[i].split("=")[1];
                    //theRequest[name]=unescape(value);
                    theRequest[name]=decodeURI(value);
                }
            }
            return theRequest;
        };

</script>
</body>
</html>

